package file;

/**
 * 目录的删除
 */
public class DeleteDirDemo01 {
    public static void main(String[] args) {
        java.io.File file = new java.io.File("pics");
        //判断文件对象是否存在，是否是目录
        if (file.isDirectory()&&file.isDirectory()){
            boolean flag = file.delete(); //只能删除一层空目录
            System.out.println(flag ? "delete ok" : "delete fail");
        }

    }
}
